package cn.tedu.collection;

import java.util.ArrayList;
import java.util.List;

public class ListDemo {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("one");
        list.add("two");
        list.add("three");
        list.add("four");
        list.add("five");
        String e = list.get(2);
        System.out.println(e);
        for (int i=0;i<list.size();i++){
            e = list.get(i);
            System.out.println(e);
        }
        String siz = list.set(1, "siz");
        System.out.println(list);
        System.out.println("被替换的元素是:"+siz);
    }
}
